﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ScreenMonitor
{
    public partial class ManageredCmd : Form
    {
        public ManageredCmd()
        {
            InitializeComponent();
        }

        private void process1_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            textBox1.Text+=e.Data+"\r\n";
        }

        private void 启动ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            process1.Start();
            process1.BeginOutputReadLine();
            process1.BeginErrorReadLine();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            process1.StandardInput.WriteLine(textBox2.Text);
        }

        private void process1_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            textBox1.Text += e.Data + "\r\n";
        }

    }
}
